package com.yunxin.core.customer.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunxin.core.admin.domain.AdminUser;
import com.yunxin.core.application.dto.user.SysUser;
import com.yunxin.core.customer.domain.CustomerInfoDetail;
import com.yunxin.core.customer.domain.TagInfo;
import com.yunxin.core.wechat.domain.WechatTagInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.util.ObjectUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class CustomerCommonVo  {

    @Schema(description = "客户id")
    private Integer customerId;

    @Schema(description = "腰带申请订单号")
    private String applyOrderNo;

    @Schema(description = "用户编号")
    private String customerNo;

    @Schema(description ="企微客户id")
    private Integer wechatCustomerId;

    @Schema(description ="渠道id")
    private Long channelId;

    @Schema(description ="渠道name")
    private String channelName;

    @Schema(description = "姓名")
    private String name;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "产品id")
    private Long productId;

    @Schema(description = "产品名称")
    private String productName;

    @Schema(description = "申请时间(最初)")
    private Date applyTime;

    @Schema(description = "团队id")
    private Integer teamId;

    @Schema(description = "团队名称")
    private String teamName;

    @Schema(description = "业务员id")
    private Integer salesmanId;

    @Schema(description = "业务员名称")
    private String salesmanName;

    @Schema(description = "业务员分配时间")
    private Date salesmanTime;

    @Schema(description = "话务员id")
    private Integer telephoneId;

    @Schema(description = "话务员名称")
    private String telephoneName;

    @Schema(description = "话务员分配时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date telephonerTime;

    @Schema(description = "拨打次数")
    private Integer callCount;

    @Schema(description = "客户状态 0未处理 1已处理")
    private Integer status;

    @Schema(description = "微信昵称")
    private String wechatName;

    @Schema(description = "微信添加时间 时间戳")
    private Long wechatCreatetime;

    @Schema(description = "微信添加时间")
    private Date wechatAddTime;

    public void setWechatCreatetime(Long wechatCreatetime) {
        this.wechatCreatetime = wechatCreatetime;
        if(!ObjectUtils.isEmpty(wechatCreatetime)){
            this.wechatAddTime = new Date(wechatCreatetime*1000L);
        }
    }

    @Schema(description = "客户评分")
    private Integer grade;

    @Schema(description = "系统客户标签")
    private List<TagInfo> tagInfoId;

    @Schema(description = "企微客户标签")
    private List<WechatTagInfo> weChatTagInfo;

    @Schema(description = "客户描述")
    private String ctDescribe;

    @Schema(description = "客户来源")
    private Integer source;

    @Schema(description = "客户级别")
    private Integer level;

    @Schema(description = "流失原因")
    private String runReason;

    @Schema(description = "业务员外呼进度 0未外呼 1已外呼")
    private Integer salesmanStatus;

    @Schema(description = "是否添加微信 0未添加 1已添加")
    private Integer isWechat;

    @Schema(description = "状态标签 ")
    private Integer telephonerStatus;

    @Schema(description = "话务最后一次跟进时间")
    private Date lastFollowTime;

//    @Schema(description = "跟进人 ")
//    private SysUser telephoner;


    @Schema(description = "企微标签id ")
    private Long wechatInfoId;

    @Schema(description = "话务员转交业务员时间")
    private Date telephonerToTime;

    @Schema(description = "业务员客户来源类型（个人 客服）")
    private String salesmanSourceType;

    @Schema(description = "成单时间")
    private Date createOrderTime;

    @Schema(description = "业务员跟进进度 0未跟进 1已跟进")
    private Integer followStatus;

    @Schema(description = "成单时间")
    private Date makeOrderTime;
    @Schema(description = "企微标签集合")
    private Object wechatTagIds;
    @Schema(description = "客户详情")
    private CustomerInfoDetail customerInfoDetail;

    @Schema(description = "分配次数")
    private Integer allotCount;

    @Schema(description = "产品对接方式")
    private Integer abutmentType;
    @Schema(description = "分配公海池时间")
    private Date seasDate;
}
